<?php
/*
 * Niken Larasati
 * larasati.n@students.amikom.ac.id
 */

class cetak_laporan_kk extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->library('tanggal');
        $this->load->library('pdf');
    }

    function cetak_kk_nomor() {
        $this->load->model('umum_m');
        $this->load->model('kk_m');
        $data_kk = $this->kk_m->detail_cari(array('no_kk' => $this->uri->segment(3)))->row();
        $tanggal = date("d-m-Y");
        $this->pdf->SetCreator(PDF_CREATOR);
        $this->pdf->SetAuthor('SI Gunungsari');
        $this->pdf->SetTitle('Laporan Penduduk');
        $this->pdf->SetSubject('Laporan Penduduk');
        $this->pdf->SetKeywords('Laporan Penduduk');
        $this->pdf->setPrintHeader(false);
        $this->pdf->setPrintFooter(false);
        // set default header data
        $this->pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);
        // set default monospaced font
        $this->pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

        $this->pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
        $this->pdf->SetHeaderMargin(PDF_MARGIN_HEADER);

        //set auto page breaks
        $this->pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

        //set image scale factor
        $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

        //set some language-dependent strings
        //       $this->pdf->setLanguageArray($l);
        // ---------------------------------------------------------
        // set font
        $this->pdf->SetFont('times', '', 9);

        // add a page
        $this->pdf->AddPage('L', 'A4');
        ob_start();
        ?>

        <div>
            <div align="center"><strong>FORMULIR PERMOHONAN KARTU KELUARGA (KK)</strong></div>
            <br>
            <br>
            <table width="100%" border="0">
                <tr>
<!--                    KIRI-->
                    <td width="18%">Nama Kepala Keluarga<></td>
                    <td width="2%">:</td>
                    <td width="40%"><?php echo $data_kk->nama_kk;?></td>
<!--                    KANAN-->
                    <td width="18%">Propinsi</td>
                    <td width="2%">:</td>
                    <td width="20%">Jawa Timur</td>
                </tr>
                <tr>
                    <td>Alamat<></td>
                    <td>:</td>
                    <td><?php echo $data_kk->alamat.' Dusun '.$data_kk->dusun.'<br> RT '.$data_kk->rt.' RW '.$data_kk->rw;?></td>
                    
                    <td>Kabupaten <br>Kecamatan</td>
                    <td>:<br>:</td>
                    <td>Pacitan<br>Arjosari</td>
                </tr>
                <tr>
                    <td>Kode Pos<></td>
                    <td>:</td>
                    <td>63581</td>
                    
                    <td>Desa</td>
                    <td>:</td>
                    <td>Gunungsari</td>
                </tr>
                <tr>
                    <td>Jenis Permohonan</td>
                    <td>:</td>
                    <td>KK yang baru diterbitkan karena :<br></td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td colspan="4">A. Baru     B. Ada Kelahiran    C. Numpang      D. Kematian     E. Hilang / Rusak</td>
                </tr>
            </table>
            <br>
            <br>
            <table width="100%" border="1" align="center">
                <tr>
                    <td width="4%" bordercolor="#666666"><div align="center"><strong>No.</strong></div></td>
                    <td width="14%" bordercolor="#666666"><div align="center"><strong>Nama</strong></div></td>
                    <td width="14%" bordercolor="#666666"><div align="center"><strong>NIK</strong></div></td>
                    <td width="7%" bordercolor="#666666"><div align="center"><strong>Jenis Kelamin</strong></div></td>
                    <td width="9%" bordercolor="#666666"><div align="center"><strong>Tempat Lahir</strong></div></td>
                    <td width="9%" bordercolor="#666666"><div align="center"><strong>Tgl Lahir</strong></div></td>
                    <td width="9%" bordercolor="#666666"><div align="center"><strong>Agama</strong></div></td>
                    <td width="11%" bordercolor="#666666"><div align="center"><strong>Pendidikan</strong></div></td>
                    <td width="12%" bordercolor="#666666"><div align="center"><strong>Pekerjaan</strong></div></td>
                </tr>
                <tr>
                    <td>1
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                    </td>
                    <td>2</td>
                    <td>3</td>
                    <td>4</td>
                    <td>5</td>
                    <td>6</td>
                    <td>7</td>
                    <td>8</td>
                    <td>9</td>                  
                </tr>                
            </table>
            <br>
            <br>
            <table width="100%" border="1" align="center">
                <tr>
                    <td width="4%" bordercolor="#666666"><div align="center"><strong>No.</strong></div></td>
                    <td width="14%" bordercolor="#666666"><div align="center"><strong>Status Perkawinan</strong></div></td>
                    <td width="14%" bordercolor="#666666"><div align="center"><strong>Status Hubungan Dalam Keluarga</strong></div></td>
                    <td width="12%" bordercolor="#666666"><div align="center"><strong>Kewarganegaraan</strong></div></td>
                    <td width="11%" bordercolor="#666666"><div align="center"><strong>No. Paspor</strong></div></td>
                    <td width="11%" bordercolor="#666666"><div align="center"><strong>No. KITAS</strong></div></td>
                    <td width="11%" bordercolor="#666666"><div align="center"><strong>Nama Ibu</strong></div></td>
                    <td width="12%" bordercolor="#666666"><div align="center"><strong>Nama Ayah</strong></div></td>
                </tr>
                <tr>
                    <td>
                        <br>
                        <br>
                        <br>
                        <br>
                        <br>
                    </td>
                    <td>10</td>
                    <td>11</td>
                    <td>12</td>
                    <td>13</td>
                    <td>14</td>
                    <td>15</td>
                    <td>16</td>                
                </tr>                
            </table>
            <br>
            <br>
            <table width="100%" border="0" align="center">
            <tr align="center" >
                    <td>Mengetahui,
                        <br>Camat Arjosari
                        <br>
                        <br>
                        <br>
                        <br>AMAT TAUFAN, S.Sos
                    </td>
                    <td>Menyetujui,
                        <br>Kepala Desa Gunungsari
                        <br>
                        <br>
                        <br>
                        <br>Bakri
                    </td>
                    <td>Pacitan,<?php echo $tanggal; ?>
                        <br>Pemohon,
                        <br>
                        <br>
                        <br>
                        <br><?php echo $data_kk->nama_kk; ?>
                    </td>
            </tr>
            </table>
        </div>


        <?php
        $konten_2 = ob_get_contents();
        ob_end_clean();


        $this->pdf->writeHTML($konten_2, true, false, true, false, '');
        $this->pdf->Output('Laporan Penduduk.pdf', 'I');
    }

}
?>
